package com.ainiyar.springweb.pojo.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**************************************
 * File Name : Permission
 * Created with : IntelliJ IDEA.
 * Author : 艾尼亚尔·毛拉吾提
 * QQ : 524155792  WeChat : ainiyar0124
 * Created Time : 2024/2/5  00:47
 * Desc :菜单权限实体类
 ***************************************/
@Data
@Table("sw_menu")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Menu {
    @Id(keyType = KeyType.Auto)
    private Long id;
    private String label;
    private Long parentId;
    private String parentName;
    private String code;
    private String name;
    private String url;
    private Integer eLink;
    private String icon;
    private Integer hideMenu;
    private Integer type;
    private String sort;
    private Integer isDelete;
    @Column(onInsertValue = "NOW()")
    private LocalDateTime createTime;
    @Column(ignore = true)
    private String create_time;
    @Column(onUpdateValue = "NOW()")
    private LocalDateTime updateTime;
    @Column(ignore = true)
    private String update_time;
    //子菜单列表
    @JsonInclude(JsonInclude.Include.NON_NULL) //属性值为null不进行序列化操作
    @Column(ignore = true) //不是数据表字段
    private List<Menu> children = new ArrayList<Menu>();
}

